package com.mvc.my.root.controller;

import com.mvc.my.root.annotation.ResponseBody;
import com.mvc.my.root.annotation.ResponseView;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


public class test extends HttpServlet {

    @ResponseBody("/hello.do")
    public String hello(HttpServletRequest req, HttpServletResponse resp){
        return "hello world";
    }

    @ResponseView("/view.do")
    public void view(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {
        req.getRequestDispatcher("/view.html").forward(req,resp);
    }
}
